package mvc 
{
	import flash.display.DisplayObject;
	import flash.display.IBitmapDrawable;
	
	/**
	 * A Renderer is used as a back-end to render Views to the screen
	 * @author rivaledsouls
	 */
	public interface Renderer extends IBitmapDrawable
	{		
		/**
		 * Adds a View to the Renderer, it will be rendered subsequently
		 * @param	view	the View to add to the Renderer
		 * @return	the View that was added to the renderer
		 */
		function addView(view:View):View;
		/**
		 * Removes a View from the Renderer, it will no longer be rendered
		 * @param	view the View to remove from the Renderer
		 * @return the View that was removed from the renderer or null if the view was never added to the Renderer
		 */
		function removeView(view:View):View;
		/**
		 * Checks if a view has been added to the Renderer
		 * @param	view the View to check if it's contained in Renderer
		 * @return true if view has been added to the Renderer, false otherwise
		 */
		function containsView(view:View):Boolean;
		
		
		/**
		 * Adds a ViewPort to the Renderer, it will be rendered subsequently
		 * @param	viewport	the ViewPort to add to the renderer
		 * @return	the ViewPort that was added to the renderer
		 */
		function addViewPort(viewport:Viewport):Viewport;
		/**
		 * Removes a ViewPort from the Renderer, it will no longer be rendered
		 * @param	viewport the ViewPort to remove from the Renderer
		 * @return the ViewPort that was removed from the renderer or null if the ViewPort was never added to the Renderer
		 */
		function removeViewPort(viewport:Viewport):Viewport;
		/**
		 * Checks if a ViewPort has been added to the Renderer
		 * @param	viewport the ViewPort to check if it's contained in Renderer
		 * @return true if viewport has been added to the Renderer, false otherwise
		 */
		function containsViewPort(viewport:Viewport):Boolean;
		
		
		/**
		 * Update will be called every frame by Game, don't worry about it.
		 * @param	dt	the amount of time (in seconds) that has passed since the last update
		 */
		function update(dt:Number):void;
		/*
		 * This function handles all of the rendering. Recommended implementation:
		 * First it updates all of the Views,then it loops through all of the ViewPorts
		 * and renders all of the Views contained in each.
		 */
	}
	
}